package com.moshang.blog.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.google.common.collect.Sets;
import lombok.Getter;
import lombok.Setter;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.Set;

/**
 * @author moshang
 * @email 597575122@qq.com
 * @date 2018-09-21 14:45:09
 */
@TableName("sys_user")
@Getter
@Setter
public class SysUser extends BaseEntity implements Serializable {
    private static final long serialVersionUID = 1L;

    /**
     *
     */
    @TableId(type = IdType.AUTO)
    private Integer id;

    private String userName;

    private String password;
    /**
     * shiro加密盐
     */
    private String salt;

    private Integer age;
    private String sex;
    private String phone;
    @JsonFormat(pattern = "yyyy-MM-dd", timezone = "GMT+8", locale = "zh")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birthday;

    private String email;

    private String image;

    private String realName;


    private Integer locked;
    private Integer thirdLoginId;
    private Date lastLoginTime;
    private Integer deptId;
    @TableField(exist = false)
    private Set<SysRole> roleLists = Sets.newHashSet();

    @TableField(exist = false)
    private Set<SysMenu> menus = Sets.newHashSet();


}
